import { createApp } from "vue";
import "./styles/global.scss";
import App from "./App.vue";
import router from "./router/index.ts";
import { pinia } from "./store/index.ts";
/**
 * 引入element-plus 完整引入
 * 已经被注释了，因为使用了按需引入
 * 需要开启完整引入，请去vite.config.ts文件删掉按需引入
 */
// import ElementPlus from "element-plus";
// import "element-plus/dist/index.css";
// import "@/styles/element/index.scss";

// element-plus/icons
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// WindiCSS
import "virtual:windi.css";

/* 全局自定义组件 */
// 封装el-btn组件：与el组件库自动导入出现问题，暂不能使用❌
// import ElBtn from "@/components/ElComponents/ElBtn.vue";
// 统一svg组件
import SvgIcon from "@/components/SvgIcon.vue";
// 统一背景组件
import MyBG from "@components/MyBackGround.vue";

const app = createApp(App);
// app.component("ElBtn", ElBtn);
app.component("SvgIcon", SvgIcon);
app.component("MyBG", MyBG);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(router);
app.use(pinia);
// app.use(ElementPlus);

app.mount("#app");
